<?php

namespace app\agent\validate;

use think\Validate;

class Recharge extends Validate
{
    protected $rule = [
        'amount' => 'require|float|gt:0',
        'pay_type' => 'require|in:alipay,wxpay',
        'trade_no' => 'require',
    ];

    protected $message = [
        'amount.require' => '请填写充值金额',
        'amount.float' => '充值金额只能是数字',
        'amount.gt' => '充值金额必须大于 0',
        'pay_type.require' => '支付方式有误',
        'pay_type.in' => '支付方式有误.',
        'trade_no.require' => '请输入支付宝交易号',
    ];

    protected $scene = [
        'create' => [
            'amount',
            'pay_type',
        ],
        'queryOrderByTradeNo' => [
            'trade_no',
        ],
        'queryDmjOrderByTradeNo' => [
            'trade_no',
        ],
    ];
}
